package com.dahuyou.change.method.param;

import net.bytebuddy.asm.Advice;

public class MyByteBuddyAdvice {

    @Advice.OnMethodEnter()
    public static void enter(@Advice.Argument(value=2, readOnly=false) int param2,
                             @Advice.Origin("#t") String className,
                             @Advice.Origin("#m") String methodName) {
//        System.out.println("MyByteBuddyAdvice.enter className " + className + ", methodName is: " + methodName);
        System.out.println("MyByteBuddyAdvice.enter param2 " + param2);
        param2 = 9090;
    }

    @Advice.OnMethodExit()
    public static void exit(@Advice.Origin("#t") String className, @Advice.Origin("#m") String methodName) {
//        System.out.println("MyByteBuddyAdvice.exit className " + className + ", methodName is: " + methodName);
    }
}
